package com.kemai.androidstudy.main

import android.os.Bundle
import com.kemai.androidstudy.R
import com.kemai.common.adapter.ItemClickListener
import com.kemai.common.ui.BaseActivity
import com.kemai.common.utils.AppUtils
import com.kemai.designmode.ui.DesignModeActivity
import com.kemai.test.TestMainActivity
import com.kemai.view.ViewMainActivity

class MainActivity : BaseActivity(), ItemClickListener{
    private val studyContent = arrayOf("View","设计模式","Test")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_common_content)
        findViewById()
        setTiTle("首页")
        setAdapterContent(studyContent,MainActivity@this,MainActivity@this)

    }

    override fun itemClick(position: Int) {
        when(position){
            0->{
                showPage(MainActivity@this,ViewMainActivity::class.java)
            }
            1->{
                showPage(MainActivity@this,DesignModeActivity::class.java)
            }
            2->{
                showPage(MainActivity@this,TestMainActivity::class.java)
            }
            else->{
               AppUtils.getInstance()?.showToast("暂未开发,敬请期待")
            }
        }

    }
}